:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --background: #f5f6fa;
    --text-color: #2c3e50;
    --success: #27ae60;
    --danger: #e74c3c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--background);
    color: var(--text-color);
    line-height: 1.6;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 2rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
}

.search-box {
    position: relative;
    width: 400px;
}

#searchInput {
    width: 100%;
    padding: 0.8rem 2.5rem;
    border: 2px solid #ddd;
    border-radius: 30px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="%23999" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 0 0 1.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 0 0-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 0 0 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>') no-repeat 1rem center;
}

#searchInput:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.2);
}

#userTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

#userTable thead {
    background: var(--primary-color);
    color: white;
}

#userTable th,
#userTable td {
    padding: 1rem;
    text-align: left;
}

#userTable th {
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    position: relative;
}

#userTable th:hover {
    background: #34495e;
}

#userTable th i {
    margin-left: 0.5rem;
    opacity: 0.6;
}

#userTable tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
}

#userTable tbody tr:hover {
    background: #f8f9fa;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

.male {
    background: #3498db20;
    color: #2980b9;
}

.female {
    background: #e91e6320;
    color: #c2185b;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.toast {
    position: fixed;
    top: 20px;
    right: -300px;
    background: var(--danger);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    transition: right 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
    }

    .search-box {
        width: 100%;
    }

    #userTable thead {
        display: none;
    }

    #userTable tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        border-radius: 8px;
    }

    #userTable td {
        display: flex;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #eee;
    }

    #userTable td::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 1rem;
        color: var(--primary-color);
    }
}
/* 通用按钮样式 */
button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 删除按钮样式 */
.delete-btn {
    background-color: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background-color: #c0392b;
}

/* 修改按钮样式 */
.edit-btn {
    background-color: #3498db;
    color: white;
}

.edit-btn:hover {
    background-color: #2980b9;
}

/* 修改表单样式 */
.swal2-input {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.swal2-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.swal2-popup {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.swal2-title {
    color: #333;
    font-size: 1.5rem;
}

.swal2-confirm {
    background-color: #3498db;
    color: white;
}

.swal2-confirm:hover {
    background-color: #2980b9;
}

.swal2-cancel {
    background-color: #e2e8f0;
    color: #2d3748;
}

.swal2-cancel:hover {
    background-color: #cbd5e0;
}

/* 修改按钮样式 */
.edit-btn {
    background-color: #3498db;
    color: white;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background-color: #2980b9;
}

/* 删除按钮样式 */
.delete-btn {
    background-color: #e74c3c;
    color: white;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background-color: #c0392b;
}

/* 表单样式 */
.edit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.custom-input {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.custom-select {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

/* 聚焦效果 */
.custom-input:focus,
.custom-select:focus {
    border-color: #007BFF;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}